<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Gem::StreamUI - rubygems: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
        
<div id="extends-section" class="nav-section">
  <h3>Extended With Modules</h3>

  <ul class="link-list">
    <li><a class="extend" href="Deprecate.html">Gem::Deprecate</a>
  </ul>
</div>

        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-_gets_noecho">#_gets_noecho</a>
    <li ><a href="#method-i-alert">#alert</a>
    <li ><a href="#method-i-alert_error">#alert_error</a>
    <li ><a href="#method-i-alert_warning">#alert_warning</a>
    <li ><a href="#method-i-ask">#ask</a>
    <li ><a href="#method-i-ask_for_password">#ask_for_password</a>
    <li ><a href="#method-i-ask_yes_no">#ask_yes_no</a>
    <li ><a href="#method-i-backtrace">#backtrace</a>
    <li ><a href="#method-i-choose_from_list">#choose_from_list</a>
    <li ><a href="#method-i-close">#close</a>
    <li ><a href="#method-i-download_reporter">#download_reporter</a>
    <li ><a href="#method-i-progress_reporter">#progress_reporter</a>
    <li ><a href="#method-i-require_io_console">#require_io_console</a>
    <li ><a href="#method-i-say">#say</a>
    <li ><a href="#method-i-terminate_interaction">#terminate_interaction</a>
    <li ><a href="#method-i-tty-3F">#tty?</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Gem::StreamUI">
    <h1 id="class-Gem::StreamUI" class="class">
      class Gem::StreamUI
    </h1>

    <section class="description">
    
<p><a href="StreamUI.html"><code>Gem::StreamUI</code></a> implements a simple stream based user interface.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-errs" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">errs</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The error stream</p>
              </div>
            </div>
          <div id="attribute-i-ins" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ins</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The input stream</p>
              </div>
            </div>
          <div id="attribute-i-outs" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">outs</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The output stream</p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(in_stream, out_stream, err_stream=STDERR, usetty=true)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a new <a href="StreamUI.html"><code>StreamUI</code></a> wrapping <code>in_stream</code> for user input, <code>out_stream</code> for standard output, <code>err_stream</code> for error output.  If <code>usetty</code> is true then special operations (like asking for passwords) will use the TTY commands to disable character echo.</p>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 196</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">in_stream</span>, <span class="ruby-identifier">out_stream</span>, <span class="ruby-identifier">err_stream</span>=<span class="ruby-constant">STDERR</span>, <span class="ruby-identifier">usetty</span>=<span class="ruby-keyword">true</span>)
  <span class="ruby-ivar">@ins</span> = <span class="ruby-identifier">in_stream</span>
  <span class="ruby-ivar">@outs</span> = <span class="ruby-identifier">out_stream</span>
  <span class="ruby-ivar">@errs</span> = <span class="ruby-identifier">err_stream</span>
  <span class="ruby-ivar">@usetty</span> = <span class="ruby-identifier">usetty</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-_gets_noecho" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_gets_noecho</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="_gets_noecho-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 320</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_gets_noecho</span>
  <span class="ruby-identifier">require_io_console</span>
  <span class="ruby-ivar">@ins</span>.<span class="ruby-identifier">noecho</span> { <span class="ruby-ivar">@ins</span>.<span class="ruby-identifier">gets</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-alert" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">alert</span><span
                                class="method-args">(statement, question=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Display an informational alert.  Will ask <code>question</code> if it is not nil.</p>

                              <div class="method-source-code" id="alert-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 335</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">alert</span>(<span class="ruby-identifier">statement</span>, <span class="ruby-identifier">question</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;INFO:  #{statement}&quot;</span>
  <span class="ruby-identifier">ask</span>(<span class="ruby-identifier">question</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">question</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-alert_error" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">alert_error</span><span
                                class="method-args">(statement, question=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Display an error message in a location expected to get error messages. Will ask <code>question</code> if it is not nil.</p>

                              <div class="method-source-code" id="alert_error-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 352</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">alert_error</span>(<span class="ruby-identifier">statement</span>, <span class="ruby-identifier">question</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@errs</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;ERROR:  #{statement}&quot;</span>
  <span class="ruby-identifier">ask</span>(<span class="ruby-identifier">question</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">question</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-alert_warning" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">alert_warning</span><span
                                class="method-args">(statement, question=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Display a warning on stderr.  Will ask <code>question</code> if it is not nil.</p>

                              <div class="method-source-code" id="alert_warning-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 343</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">alert_warning</span>(<span class="ruby-identifier">statement</span>, <span class="ruby-identifier">question</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@errs</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;WARNING:  #{statement}&quot;</span>
  <span class="ruby-identifier">ask</span>(<span class="ruby-identifier">question</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">question</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ask" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ask</span><span
                                class="method-args">(question)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Ask a question.  Returns an answer if connected to a tty, nil otherwise.</p>

                              <div class="method-source-code" id="ask-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 284</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ask</span>(<span class="ruby-identifier">question</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tty?</span>

  <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">print</span>(<span class="ruby-identifier">question</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;  &quot;</span>)
  <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">flush</span>

  <span class="ruby-identifier">result</span> = <span class="ruby-ivar">@ins</span>.<span class="ruby-identifier">gets</span>
  <span class="ruby-identifier">result</span>&amp;.<span class="ruby-identifier">chomp!</span>
  <span class="ruby-identifier">result</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ask_for_password" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ask_for_password</span><span
                                class="method-args">(question)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Ask for a password. Does not echo response to terminal.</p>

                              <div class="method-source-code" id="ask_for_password-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 298</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ask_for_password</span>(<span class="ruby-identifier">question</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tty?</span>

  <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">print</span>(<span class="ruby-identifier">question</span>, <span class="ruby-string">&quot;  &quot;</span>)
  <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">flush</span>

  <span class="ruby-identifier">password</span> = <span class="ruby-identifier">_gets_noecho</span>
  <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">puts</span>
  <span class="ruby-identifier">password</span>&amp;.<span class="ruby-identifier">chomp!</span>
  <span class="ruby-identifier">password</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ask_yes_no" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ask_yes_no</span><span
                                class="method-args">(question, default=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Ask a question.  Returns a true for yes, false for no.  If not connected to a tty, raises an exception if default is nil, otherwise returns default.</p>

                              <div class="method-source-code" id="ask_yes_no-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 249</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ask_yes_no</span>(<span class="ruby-identifier">question</span>, <span class="ruby-identifier">default</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tty?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">default</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">OperationNotSupportedError</span>,
            <span class="ruby-string">&quot;Not connected to a tty and no default specified&quot;</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">return</span> <span class="ruby-identifier">default</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">default_answer</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">default</span>
                   <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
                     <span class="ruby-string">&quot;yn&quot;</span>
                   <span class="ruby-keyword">when</span> <span class="ruby-keyword">true</span>
                     <span class="ruby-string">&quot;Yn&quot;</span>
                   <span class="ruby-keyword">else</span>
                     <span class="ruby-string">&quot;yN&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">result</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-keyword">while</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">result</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">ask</span> <span class="ruby-node">&quot;#{question} [#{default_answer}]&quot;</span>
             <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^y/i</span> <span class="ruby-keyword">then</span> <span class="ruby-keyword">true</span>
             <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^n/i</span> <span class="ruby-keyword">then</span> <span class="ruby-keyword">false</span>
             <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^$/</span>  <span class="ruby-keyword">then</span> <span class="ruby-identifier">default</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">result</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-backtrace" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">backtrace</span><span
                                class="method-args">(exception)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Prints a formatted backtrace to the errors stream if backtraces are enabled.</p>

                              <div class="method-source-code" id="backtrace-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 214</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">backtrace</span>(<span class="ruby-identifier">exception</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">backtrace</span>

  <span class="ruby-ivar">@errs</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\t#{exception.backtrace.join &quot;\n\t&quot;}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-choose_from_list" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">choose_from_list</span><span
                                class="method-args">(question, list)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Choose from a list of options.  <code>question</code> is a prompt displayed above the list.  <code>list</code> is a list of option strings.  Returns the pair [option_name, option_index].</p>

                              <div class="method-source-code" id="choose_from_list-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 225</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">choose_from_list</span>(<span class="ruby-identifier">question</span>, <span class="ruby-identifier">list</span>)
  <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">question</span>

  <span class="ruby-identifier">list</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot; #{index + 1}. #{item}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">print</span> <span class="ruby-string">&quot;&gt; &quot;</span>
  <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">flush</span>

  <span class="ruby-identifier">result</span> = <span class="ruby-ivar">@ins</span>.<span class="ruby-identifier">gets</span>

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">result</span>

  <span class="ruby-identifier">result</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> (<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">list</span>.<span class="ruby-identifier">size</span>) <span class="ruby-operator">===</span> <span class="ruby-identifier">result</span>
  [<span class="ruby-identifier">list</span>[<span class="ruby-identifier">result</span>], <span class="ruby-identifier">result</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-close" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">close</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="close-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 366</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">close</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-download_reporter" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">download_reporter</span><span
                                class="method-args">(*args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Return a download reporter object chosen from the current verbosity</p>

                              <div class="method-source-code" id="download_reporter-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 499</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">download_reporter</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">if</span> [<span class="ruby-keyword">nil</span>, <span class="ruby-keyword">false</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">verbose</span>) <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">tty?</span>
    <span class="ruby-constant">SilentDownloadReporter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@outs</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-constant">ThreadedDownloadReporter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@outs</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-progress_reporter" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">progress_reporter</span><span
                                class="method-args">(*args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Return a progress reporter object chosen from the current verbosity.</p>

                              <div class="method-source-code" id="progress_reporter-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 372</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">progress_reporter</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">verbose</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">false</span>
    <span class="ruby-constant">SilentProgressReporter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@outs</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">true</span>
    <span class="ruby-constant">SimpleProgressReporter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@outs</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-constant">VerboseProgressReporter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@outs</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-require_io_console" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">require_io_console</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="require_io_console-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 310</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">require_io_console</span>
  <span class="ruby-ivar">@require_io_console</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;io/console&quot;</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">LoadError</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-say" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">say</span><span
                                class="method-args">(statement=&quot;&quot;)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Display a statement.</p>

                              <div class="method-source-code" id="say-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 328</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">say</span>(<span class="ruby-identifier">statement</span>=<span class="ruby-string">&quot;&quot;</span>)
  <span class="ruby-ivar">@outs</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">statement</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-terminate_interaction" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">terminate_interaction</span><span
                                class="method-args">(status = 0)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Terminate the application with exit code <code>status</code>, running any exit handlers that might have been defined.</p>

                              <div class="method-source-code" id="terminate_interaction-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 361</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">terminate_interaction</span>(<span class="ruby-identifier">status</span> = <span class="ruby-value">0</span>)
  <span class="ruby-identifier">close</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">SystemExitException</span>, <span class="ruby-identifier">status</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tty-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tty?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns true if TTY methods should be used on this <a href="StreamUI.html"><code>StreamUI</code></a>.</p>

                              <div class="method-source-code" id="tty-3F-source">
            <pre><span class="ruby-comment"># File rubygems/user_interaction.rb, line 206</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tty?</span>
  <span class="ruby-ivar">@usetty</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@ins</span>.<span class="ruby-identifier">tty?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

